This program is provided at no charge, without warranty or support of any kind. Use at your own risk. (Hey, what do you want for FREE?)
If you have problems, you can write to me, but I do NOT guarantee a response. If you want a customized version or assistance with changing the program, there will be a consulting fee.
This AppleScript is like the Unix "touch" program -- it sets the modification date/time of whatever is dropped onto it to the current system date and time.
The AppleScript is saved as a drag-and-drop application, but if you want to view or edit it, just drag the "Touch" icon onto the Script Editor.
Just for convenience, here's the actual script:
on open (docList)
tell application "Finder"
-- set theDate to current date
repeat with theFile in docList
if kind of theFile is not "folder" then
--set theDate to current date
--set theDate to date "8/1/96 12:34:56"
-- note: can't set creation date in AppleScript; Finder treats as Read Only.
--set creation date of file theFile to current date
set modification date of file theFile to current date
end if
end repeat
end tell
end open
The lines that are commented out are notes from development or are possible changes to modify this script for the specific purposes discussed below. The following information has not been extensively tested, it may or may not work, use at your own risk:
SETTING ALL FILES TO THE SAME TIME
Normally, we probably don't need to, but if you need to set all files dropped on it to the exact same date and time would be to uncomment (that means remove the "---" from in front of) the "--set theDate to current date" right below the "tell application Finder", and change the "set modification date of file theFile to current date" to "set modification date of file theFile to current date" to theDate".
SETTING ALL FILES TO A SPECIFIC TIME
If you need to set the date and time to a SPECIFIC date and time, uncomment the line:
--set theDate to date "8/1/96 12:34:56"
Change the date and time from 8/1/96 12:34:56 to whatever date/time you need and change the "set modification date of file theFile to current date" to "set modification date of file theFile to current date" to theDate".